dxp-ux

(0 reviews)

Create Order - Add Line (TMF 622 POST)

This operation will create the AddLine Order in Salesforce

Note - To work this fucntionality, the field "@type" not empty and value should be equal to "AddLine" in request body

URL

https://[localhost]:[port]/dxp-ux/v1/{businessId}/productOrder

URL PARAMS

nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit.Y
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel.Y
client_secretstringPassword associated with the client_id.Y
X-Correlation-IDstringIdentifier that correlates HTTP request between a client and server. Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction.Y

cURL request

curl --location 'https://nonprod.esb.cloud.lla.com/dev/dxp-ux/dxp-ux/v1/PR/productOrder' \
--header 'X-Correlation-Id: 644e1dd7-2a7f-18fb-b8ed-ed78c3F92c2b' \
--header 'client_id: xxx' \
--header 'client_secret: yyy' \
--header 'Content-Type: application/json' \
--data-raw '{
    "channel": [
        {
            "name": "Digital"    //sourceSystem
        }
    ],
    "@type": "AddLine",    //requestType
    "description": "Add New Line",    //reason
    "externalId": "127280366378939",   //sourceOrderId
    "billingAccount": {
        "id": "1231231-157657",     //bancan
        "name": "bancan",
        "@type": "AccountRef"
    },
    "payment": [
        {
            "id": "24324243242"      //transactionId
        }
    ],
    "productOrderItem": [
        {
            "product": {
                "productCharacteristic": [
                    {
                        "name": "consents",
                        "valueType": "Object",
                        "value": {
                            "consentLanguage": "EN/ES",    //consentLanguage
                            "consents": [
                                {
                                    "type": "GeneralTnC",     //type
                                    "id": "GeneralTnC",       //id
                                    "consentTextVersion": "2",     //consentTextVersion
                                    "state": "Consented"       //state
                                },
                                {
                                    "type": "InsuranceConsent",
                                    "id": "InsuranceConsent",
                                    "consentTextVersion": "2",
                                    "state": "Consented"
                                },
                                {
                                    "type": "InstConsent",
                                    "id": "InstConsent",
                                    "consentTextVersion": "2",
                                    "state": "Consented"
                                }
                            ]
                        }
                    },
                    {
                        "name": "deliveryAddress",
                        "valueType": "Object",
                        "value": {
                            "street1": "11237 ",    //street1
                            "street2": "CALLE JAZMIN",    //street2
                            "city": "SANTA ISABEL",       //city
                            "postalcode": "007573126",    //postalcode
                            "state": "PR",        //state
                            "country": "US",      //country
                            "deliveryType": "Mail Delivery",    //deliveryType
                            "deliverySpeed": "Standard"         //deliverySpeed
                        }
                    },
                    {
                        "name": "lineDetails",
                        "valueType": "array",
                        "value": [
                            {
                                "lineNumber": "1",    //lineNumber
                                "planDetails": {
                                    "msisdn": "2432666644",    //msisdn
                                    "nokiaReservationId": "234234234",    //nokiaReservationId
                                    "planSku": "PR_B2C_ULT_Starter_MB_Line",    //planSku
                                    "simType": "Physical SIM/Dynamic SIM",     //simType
                                    "aliasFirstName": "John",      //aliasFirstName
                                    "aliasLastName": "Luis",       //aliasLastName
                                    "addOnDetails": [
                                        {
                                            "addonName": "Liberty International Passport",     //addonName
                                            "addonId": "PR_B2C_Mobile_IntRmg_Voice",       //addonId
                                            "attributeCode": "PR_B2C_Mb_ATT_Roaming_Add_On_Plan",     //attributeCode
                                            "attributeValue": "Internation Day Pass $10/day"         //attributeValue
                                        },
                                        {
                                            "addonName": "International Calling",
                                            "addonId": "PR_B2C_Mobile_International_Calling",
                                            "attributeCode": "PR_B2C_Mb_ATT_Voice_Add_On_Plan",
                                            "attributeValue": "International calling Add-ons $10"
                                        },
                                        {
                                            "addonName": "Liberty Home & Road Assistance",
                                            "addonId": "PR_B2C_Liberty_Home_Roadside_Assistance",
                                            "attributeCode": "PR_B2C_MB_ATT_Liberty_Assistance_Plan",
                                            "attributeValue": "Liberty Home and Roadside Assistance"
                                        }
                                    ]
                                },
                                "deviceDetails": {
                                    "deviceSku": "106655",        //deviceSku
                                    "reservationId": "85299",     //reservationId
                                    "installments": true,         //installments
                                    "installmentDetails": {
                                        "term": "12",             //term
                                        "frequencyAmount": "55",  //frequencyAmount
                                        "financedAmount": "550",  //financedAmount
                                        "downpayment": "100",    //downpayment
                                        "downpaymentTax": "10"   //downpaymentTax
                                    },
                                    "quickUpgrade": false,     //quickUpgrade
                                    "insurance": "1",      //insurance
                                    "byod": true,       //byod
                                    "byodDetails": {
                                        "imei": "141241414142141", //IMEI Number
                                        "model": "iphone 15",   //Device Model
                                        "manufacturer": "Apple",   //Device Manufaturer
                                        "capacity": "256GB",    //Device storage capacity
                                        "color": "Gold"    //Device color
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "name": "creditDetails",
                        "valueType": "Object",
                        "value": {
                            "creditScore": "780",    //creditScore
                            "creditSegment": "K",    //creditSegment
                            "creditScoreDate": "2021-07-26"    //creditScoreDate
                        }
                    },
                    {
                        "name": "PaymentDetails",
                        "valueType": "Object",
                        "value": {
                            "paymentCaptured": true    //paymentCaptured
                        }
                    }
                ]
            }
        }
    ]
}'
Definitions

Each of the request parameters is detailed.

nametype (Lenght)descriptionrequired
channelarrayA list of related channelsY
channel.namestring (20)Source System information for tracking purposeY
descriptionstring (30)reason, Eg: "Add New Line"Y
externalIdstring (20)a unique id of the order from the source systemY
billingAccountobjecctAccount reference.Y
billingAccount.idstring (30)Account numberY
billingAccount.namestringName of the account, this is not passing to SalesforceN
billingAccount.@typestringReference type, this is not passing to SalesforceN
paymentarraypayment info. Mandatory only if paymentCaptured is trueY*
payment.idstring (30)Payment transactionId. Mandatory only if paymentCaptured is trueY*
@typestring (20)request type information:
Expected value will be: 'AddLine'
Note- To work this functionality this type should be passed as 'AddLine'
Y
productOrderItemarrayA list of product order itemsY
productOrderItem.productobjectA product ref or valueY
productOrderItem.product.productCharacteristicArrayDescribes a given characteristic of an object or entity through a name/value pair.Y
productOrderItem.product.productCharacteristic.nameStringName of the characteristicY
productOrderItem.product.productCharacteristic.valueObject/ArrayThe value of the characteristicY
productOrderItem.product.productCharacteristic.valueTypestringValue data typeN
CONSENTS productCharacteristic values
characteristic nametype (Length)descriptionrequired
consentsArrayContainer for customer consentsY*
consentLanguagestring (10)Language of the consents, Eg: EN or ESY*
consents[].typestring (20)Type of the consentY*
consents[].idstring (20)Id of the consentY*
consents[].consentTextVersionstring (5)version of the consentY*
consents[].statestring (20)state of the consent (Consented / Not Consented)Y*

Note: The consent object is mandatory if consents.type is "GeneralTnC" else optional

DELIVERY-ADDRESS productCharacteristic values
characteristic nametype (Length)descriptionrequired
deliveryAddressobjectDelivery AddressY
street1string (50)Street 1 of addressY
street2string (50)Street 2 of addressN
citystring (50)City nameY
postalcodestring (50)Postal codeY
statestring (50)State codeY
countrystring (50)Country codeY
deliveryTypestring (20)must be 'Mail Delivery'Y
deliverySpeedstring (20)must be 'Standard'Y
LINE-DETAILS productCharacteristic values
characteristic nametype (Length)descriptionrequired
lineDetailsarrayDetails of each line including plan and deviceY
lineNumberstring (5)1, 2,3 etc - its mandatory if lineDetails object is presentY
planDetailsobjectDetails of the planY
planDetails{}.msisdnstring (20)Plan msisdnY
planDetails{}.nokiaReservationIdstring (30)Nokia reservation id of the msisdnY
planDetails{}.planSkustring (60)The salesforce Product codeY
planDetails{}.simTypestring (30)Type of the simY
planDetails{}.aliasFirstNamestring (50)First name of the customer holding this lineY
planDetails{}.aliasLastNamestring (50)Last name of the customer holding this lineY
planDetails{}.addOnDetailsarrayAdd on details.
Note - Minimum one object is mandatory if this addOnDetails array comes.
N
planDetails{}.addOnDetails[].addonNamestring (60)add-on nameY
planDetails{}.addOnDetails[].addonIdstring (60)add-on unique codeY
planDetails{}.addOnDetails[].attributeCodestring (60)attribute unique codeY
planDetails{}.addOnDetails[].attributeValuestring (60)attribute valueY
deviceDetailsobjectDevice detailsY
deviceDetails{}.deviceSkustring (20)sku of the deviceY
deviceDetails{}.reservationIdstring (20)SAP reservation id of the deviceY
deviceDetails{}.installmentsbooleantrue or falseY
deviceDetails{}.quickUpgradebooleantrue OR falseY
deviceDetails{}.insurancestring (20)1 OR 4 OR blankN
deviceDetails{}.byodbooleantrue OR falseN
deviceDetails{}.byodDetails{}objectBYOD detailsN
deviceDetails{}.byodDetails{}.imeistringIMEI number of the deviceN
deviceDetails{}.byodDetails{}.modelstringDevice ModelN
deviceDetails{}.byodDetails{}.manufacturerstringDevice ManufacturerN
deviceDetails{}.byodDetails{}.capacitystringDevice storage capacityN
deviceDetails{}.byodDetails{}.colorstringDevice colorN
deviceDetails{}.installmentDetailsobjectmandatory if Installments is trueY*
deviceDetails{}.installmentDetails{}.termstring (5)The term of the installmentY
deviceDetails{}.installmentDetails{}.frequencyAmountstring (10)The monthly installment amountY
deviceDetails{}.installmentDetails{}.financedAmountstring (10)Total financed amountY
deviceDetails{}.installmentDetails{}.downpaymentstring (10)Down payment of the installmentY
deviceDetails{}.installmentDetails{}.downpaymentTaxstring (10)Tax of down paymentY
CREDIT-DETAILS productCharacteristic values
characteristic nametype (Length)descriptionrequired
creditDetailsobjectCredit infoN
creditScorestring (10)Credit scoreN
creditSegmentstring (5)credit SegmentN
creditScoreDatestring (20)Credit score captured dateN

Note: All three credit check parameters together are mandatory OR all of them together optional.

PAYMENT-DETAILS productCharacteristic values
characteristic nametype (Length)descriptionrequired
PaymentDetailsobjectPayment infoY
paymentCapturedbooleanPayment Captured (true OR false)Y

Possible response success

This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.

[ 201 ]

Created - update request processed successfully, response body contains an entity corresponding to the requested resource.

{
    "state": "acknowledged",
    "note": [
        {
            "text": "Order request received Successfully"
        }
    ]
}
Definitions

Each of the request parameters is detailed.

nametypedescriptionrequired
statestringThe state of the orderN
notearrayExtra information about a given entityN
note[].textstringText of the noteN

Possible response error

In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.

[ 400 ]
{
    "errors": [
        {
            "code": 400,
            "message": "SF:POST_PRODUCTORDER",
            "description": "Required parameters missing"
        }
    ]
}
[ 401 ]

Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.

{
    "errors": [
        {
            "code": 401,
            "message": "The user could not be authenticated for this request.",
            "description": "The request has not been applied because it lacks valid authentication credentials for the target resource"
        }
    ]
}
[ 403 ]

Forbidden - Indicates that the server understood the request but refuses to fulfill it. If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials.

[ 404 ]

Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

{
    "errors": [
        {
            "code": 404,
            "message": "The request is invalid or not properly formed.",
            "description": "The requested operation failed because a resource associated with the request could not be found."
        }
    ]
}
[ 405 ]

Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

{
    "errors": [
        {
            "code": 405,
            "message": "APIKIT:METHOD_NOT_ALLOWED",
            "description": "HTTP Method post not allowed for : /{businessId}/productOrder"
        }
    ]
}
[ 429 ]

Too Many Requests - client has sent too many requests in a space of time (rate limiting). When a server is under attack or just receiving a very large number of requests from a single party, responding to each with a 429 status code will consume resources. Therefore, servers may drop connections or take other steps instead of responding with the 429 status code, when limiting resource usage.

{
    "errors": [
        {
            "code": 429,
            "message": "Too Many Requests.",
            "description": "The requested operation failed because the client has sent too many requests in a given amount of time"
        }
    ]
}
[ 500 ]

Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.

{
    "errors": [
        {
            "code": 500,
            "message": "The request failed due to an internal error.",
            "description": ""
        }
    ]
}
[ 501 ]

Not implemented - indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.

{
    "errors": [
        {
            "code": 501,
            "message": "Not implemented",
            "description": "Operation POST /productOrder for Business Id: xxxx not implemented"
        }
    ]
}
[ 502]

Bad Gateway - gateway is available but backend service is not. The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

[ 503 ]

Service Unavailable - temporary maintenance of service, try again later. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay will be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response. Note: The existence of the 503 status code does not imply that a server will use it when becoming overloaded. Servers may simply refuse the connection.


Reviews